<html><body bgcolor=pink ><font size=2></font></body></html>
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*" %>
<%   Connection con;
     Statement sql; 
     ResultSet rs;
     try{  Class.forName("com.mysql.jdbc.Driver");
     }
     catch(Exception e){
        out.println("忘记把MySQL数据库的JDBC-数据库驱动程序复制到JDK的扩展目录中");
     }
          String uri="jdbc:mysql://127.0.0.1/cj";
          String user="root";
          String password="";
          boolean flag=false;  
          con=DriverManager.getConnection(uri,user,password);
          sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                                 ResultSet.CONCUR_READ_ONLY);
          String u=(String)request.getParameter("user");
          String pa=(String)request.getParameter("password");
          String condition="SELECT * FROM"+" dl"+" where user='"+u+"'";
          sql=con.createStatement();
          rs= sql.executeQuery(condition);
        
         if( rs.next() ){
        	  if(pa.equals(rs.getString(2))&& pa.equals(null)){
              request.getRequestDispatcher("input.jsp").forward(request,response);
         } else {  
        	out.print("登陆失败");
        	
    %>
          <form action="dl.jsp" method=post>
          <br><input type="submit" name="b" value="重新登陆">
           
         <%
         }}
         con.close();
         %> 
      
  
